package com.jizi.machine.config;

import com.jizi.machine.service.TencentOCRService;
import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AllArgsConstructor
@ConditionalOnClass(ShopBasicConfig.class)
public class ShopBeanConfig {
 
	private final ShopBasicConfig shopBasicConfig;
 
	@Bean
	public TencentOCRService tencentOCRService() {
		TencentOCR tencentOCR = shopBasicConfig.getTencentOCR();
		return new TencentOCRService(tencentOCR.getSecretId(), tencentOCR.getSecretKey());
	}
}